#define _CRT_SECURE_NO_WARNINGS 1
#include "Tree.h"

int main()
{
	BTNode* node1 = BTNodeInit(1);
	BTNode* node2 = BTNodeInit(2);
	BTNode* node3 = BTNodeInit(3);
	BTNode* node4 = BTNodeInit(4);
	BTNode* node6 = BTNodeInit(6);
	BTNode* node7 = BTNodeInit(7);
	node1->left = node2;
	node1->right = node3;
	node2->left = node4;
	node3->left = node6;
	node3->right = node7;
	BTNode* root = node1;
	PreOrder(root);//1 2 4 3 6 7
	printf("\n");
	InOrder(root);//4 2 1 6 3 7
	printf("\n");
	PostOrder(root);//4 2 6 7 3 1
	printf("\n");
	printf("%d\n", BinaryTreeSize(root));
	printf("%d\n", BinaryTreeLeafSize(root));
	printf("%d\n", BinaryTreeLevelKSize(root, 3));
	printf("%d\n", BinaryTreeDepth(root));
	BTNode* findNode = BinaryTreeFind(root, 7);
	if (findNode != NULL)
	{
		printf("%d\n", findNode->val);
	}
	BinaryTreeDestory(&root);
	return 0;
}